﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BusinessObjects.BO_GetObjects;
using LibraryO2S;
using BusinessObjects;

public partial class controls_admin_HelpContent : Pages_Base
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (divMessage.InnerHtml != "")
            divMessage.InnerHtml = "";
        loadContent();
    }
    private void loadContent()
    {
        try
        {
            base.OpenConnection();
            if (Request["id"] != null)
            {
                int id = Convert.ToInt32(Request["id"]);
                DataTable objDT = BO_HelpDetail.Search(id);
                if (objDT.Rows.Count > 0)
                {
                    if (String.IsNullOrEmpty(objDT.Rows[0]["HELP_DETAILS"].ToString().Trim()))
                    {
                        divMessage.InnerHtml = O2S_Message.Warning("Cảnh Báo", "Chưa có nội dung trợ giúp");
                        return;
                    }
                    content.InnerHtml = objDT.Rows[0]["HELP_DETAILS"].ToString();
                }
                else
                    divMessage.InnerHtml = O2S_Message.Warning("Cảnh Báo", "Chưa có nội dung trợ giúp");
            }
        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }finally { base.CloseConnection(); }
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx?module=searchresult&search=" + txtSearch.Text.Trim());
    }
}
